package exercise;

/**
 * 单例模式：懒汉式，只有在获取的时候才初始化
 *
 * @author luoyalan
 * @date 2018/11/25
 */
public class LazySingleStudent {
    private static LazySingleStudent instance = null;

    private LazySingleStudent() {
    }

    public static LazySingleStudent getInstance() {
        if (instance == null) {
            instance = new LazySingleStudent();
        }
        return instance;
    }
}
